home *** CD-ROM | disk | FTP | other *** search
/ The Games Machine 76 / XENIATGM66.iso / Indiana Jones / Indiana Jones.exe / RESOURCE / PREVIEW.GOB / cog_shs_etdoor.cog < prev    next >
Text File  |  1999-11-15  |  3KB  |  123 lines

  1. # Jones 3D Cog Script
  2. #
  3. # SHS_ETdoor.cog      Make the door to the courtyard open/close.  
  4. #
  5. # [JWC, SXC]
  6. #
  7. # (C) 1999 LucasArts Entertainment Company LLC. All Rights Reserved
  8. #
  9. # ========================================================================================
  10.  
  11. symbols
  12.  
  13. message activated
  14. message    startup
  15.  
  16. sector  doorsector
  17.  
  18. sound   doormove=shs_door_double.wav        local
  19.  
  20. thing    door0
  21. thing   door1
  22. thing   button       
  23. thing    player            local
  24. thing    interpcam
  25.  
  26. int      filter=0         local        # prevent multiple activates    
  27. int        position=0        local        # door open or closed 
  28.  
  29. cog        noworktalkcog
  30.  
  31. end
  32.  
  33. # ========================================================================================
  34.  
  35. code
  36.  
  37.  
  38. startup:
  39.    
  40.    
  41.     player= GetLocalPlayerThing();
  42.     # Doors start open                         
  43.     Rotate(door0, -90, 1, .1);
  44.     Rotate(door1, 90, 1, .1);
  45.     return;
  46.  
  47. activated:
  48.    
  49.     if (GetCurItem(player) != 0) return; # prevents activating with chalk
  50.  
  51.     if ((GetSenderRef() == button) && (filter == 0))
  52.     {
  53.         Print("activated");
  54.         filter=1;
  55.         StartCutscene(0);
  56.         SetActorFlags(player, 0x200000);
  57.         StopThing(player);
  58.         DeselectWeapon(player);
  59.         DeselectWeaponWait(player);
  60.     
  61.         SetExtCamOffsetToThing(interpCam);
  62.         
  63.         # allow camera to set
  64.         Sleep(0.5);
  65.  
  66.         # play indy anim        
  67.            PlayMode(player, 60, 0);
  68.         
  69.         # pause to synch with button
  70.         Sleep(0.2);            
  71.         
  72.         MoveToFrame(button, 1, 2);
  73.         WaitForStop(button);
  74.        
  75.         if (global3 == 1) 
  76.         {
  77.             if (position == 1) 
  78.             {
  79.                 # Open doors                         
  80.                 SetSectorAdjoins(doorsector, 1);
  81.                 Rotate(door0, -90, 1, 3.0);
  82.                 Rotate(door1, 90, 1, 3.0);
  83.                 PlaySoundThing(doormove, door0, 1.0, 4, 8, 0);
  84.                 WaitForStop(door0);
  85.                 position=0;
  86.             }
  87.             else
  88.             {
  89.                 # Close doors             
  90.                 rotate(door0, 90, 1, 3.0);
  91.                 rotate(door1, -90, 1, 3.0);
  92.                 PlaySoundThing(doormove, door0, 1.0, 4, 8, 0);
  93.                 WaitForStop(door0);
  94.                 # turn sector off
  95.                 SetSectorAdjoins(doorsector, 0);
  96.                 position=1;
  97.             }
  98.         }
  99.         else
  100.         {
  101.             SendMessageEx(NoWorkTalkCog, user1, 0, 0, 0, 0);
  102.             global15 = 0; # per Randy
  103.             while (global15 == 0)
  104.             {
  105.                 Sleep(0.01); # wait for line to finish
  106.             }
  107.         }
  108.  
  109.         # Give control back to player    
  110.         RestoreExtCam();
  111.         ClearActorFlags(player, 0x200000);
  112.         EndCutscene();
  113.                              
  114.         MoveToFrame(button, 0, 2);
  115.         WaitForStop(button);
  116.         filter=0;
  117.     }
  118.     return;
  119.     
  120. end
  121.  
  122.  
  123.